<!--
 * @Author: 王明明834578987 10266004+wang-mingming-834578987@user.noreply.gitee.com
 * @Date: 2024-08-29 10:59:23
 * @LastEditors: 王明明834578987 10266004+wang-mingming-834578987@user.noreply.gitee.com
 * @LastEditTime: 2024-10-25 10:19:44
 * @FilePath: \ft-apply-admin\src\views\applicationDetails\Modals\Modal.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <component :is="componentId" ref="modal" @closeModal="closeModal" :param="param"></component>
</template>
<script setup lang='ts'>
import { onMounted, ref, nextTick } from "vue"
import ResumeModificationRecordModal from "./ResumeModificationRecordModal.vue"; //简历修改记录
import InternalPushModal from "./InternalPushModal.vue";  //内推详情
import AddMaintenanceRecordsModal from "./AddMaintenanceRecordsModal.vue";  //新增维护记录
import ModifyApplicationProgressModal from "./ModifyApplicationProgressModal.vue";  //修改应聘进度
import ChangeHRModal from "./ChangeHRModal.vue"; //修改约面HR
import BookInterviewModal from "./BookInterviewModal.vue";  //预约面试
import SurrenderModal from "./SurrenderModal.vue";  //放弃
import AddTrainingEvaluation from "./AddTrainingEvaluation.vue"; //新增培训评价
import EntryModal from "./EntryModal.vue" //入职
import NewEvaluation from "./NewEvaluation.vue"; //新增评价
import DimissionModal from "./DimissionModal.vue";  //离岗
import EditModal from "./EditModal.vue";  //修改简历
const componentId = ref(EditModal);
const modal = ref<any>(null);
const componentMap = {
  ResumeModificationRecordModal,
  InternalPushModal,
  AddMaintenanceRecordsModal,
  ModifyApplicationProgressModal,
  ChangeHRModal,
  BookInterviewModal,
  SurrenderModal,
  AddTrainingEvaluation,
  EntryModal,
  NewEvaluation,
  DimissionModal,
  EditModal
}
onMounted(() => {
})
const param = ref<any>({})
const showDialog = async (componentName: string, params: any|null) => {
  if(params){
    param.value = params
  }
  componentId.value = componentMap[componentName];
  await nextTick();
  modal.value.show = true
}

const closeModal = () => {
  modal.value.show = false
}
defineExpose({
  showDialog
})
</script>

<style></style>